<template>
	<view>
		<view class="card">
			<view class="title">
				子组件A
			</view>
			<view>
				<text>父组件传进的值:</text>
				<text style="color: red;">{{intent}}</text>
			</view>
			<button type="primary" @click="sendData()">传值给组件B</button>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['intent'],

		name: "PassValueComA",
		data() {
			return {

			};
		},
		
		methods:{
			sendData() {
				console.warn("----ComA----sendData---->"+this.intent);
				uni.$emit('getIntent',this.intent);
			}
		}
	}
</script>

<style>
	.card {
		border-radius: 8px;
		padding: 10px;
		background-color: aliceblue;
		border: 1px solid #DDD;
		margin: 10px;
	}
	.title {
		font-size: 20px;
		text-align: center;
	}
</style>